<template>
  <div class="search">
    <f-form ref="form" :action="api.shop.setShopState" :form-key="this.formItem.shopId">
      <f-form-item label="店铺状态" name="shopState" :required="true" type="radio"   :data="api.shop.shopState2" :value.sync="formItem.shopState" data-type="number" v-if="loaded"/>
      <f-form-item label="违规原因" name="auditContent" :required="true" type="textarea" :value.sync="formItem.auditContent" v-if="formItem.shopState==10"/>
    </f-form>
  </div>
</template>

<script>

  export default {
    name: 'ShopAudit',
    props: {},
    data() {
      return {
        loaded:false,
        saving: false,
        modalVisible: false,
        formItem: this.getFormItem()
      }
    },
    methods: {
      getFormItem() {
        return {
          shopState: 2
        }
      },
      setData(data) {
        this.$refs.form.resetFields()
        if (data && data.shopId) {
          this.http.get(this, {
            url: this.api.shop.get,
            params: {
              shopId: data.shopId
            },
            success: function(me, data) {
              me.loaded = true
              me.formItem = data
            }
          })
          this.isAdd = false
        } else {
          this.formItem = this.getFormItem()
          this.loaded = true
        }
      },
      handleSubmit(callback) {
        this.$refs.form.handlerSubmit({shopId:this.formItem.shopId},callback)
      }
    },
    created() {

    },
    components: {}
  }
</script>

<style scoped lang="less" rel="stylesheet/less">

</style>
